

import GameCtrl from "./GameCtrl";
import GameView from "./GameView/GameView";

const { ccclass, property } = cc._decorator
@ccclass
export default class GameScene extends cc.Component {

    @property(cc.Prefab) gameViewPrefab: cc.Prefab = null
 

    private gameCtrl: GameCtrl = null
    private gameView: GameView = null

    start() {
        this.gameView = cc.instantiate(this.gameViewPrefab).getComponent(GameView)
        this.node.addChild(this.gameView.node)
        this.gameCtrl = new GameCtrl()
        this.gameCtrl.Init(this.gameView)
        this.gameCtrl.Play()
    }
    protected onDestroy(): void {
        this.gameCtrl.Exit()
    }
}